package com.java.redis;

import redis.clients.jedis.Jedis;

public class RedisUtils {
    private volatile Jedis client;
    public RedisUtils(String host, int port){
        if (client == null){
            synchronized (RedisUtils.class){
                if (client == null){
                    client = new Jedis(host,port);
                }
            }
        }
    }

    public long setnx(String key, String value){
        return client.setnx(key, value);
    }
}
